#include <bits/stdc++.h>
using namespace std;
#define int long long

int n, m, dp[129][100005];
const int p = 998244353;
bool vis[6];
map<vector<int>, int> hashv; int tot = 0;
vector<int> edges[129];

void dfs(int i, vector<int> res) {
	if (i == n + 1) return hashv[res] = ++tot, void();
	for (int j = 1; j <= n; ++j) {
		if (!vis[j]) {
			vis[j] = 1; res.push_back(j);
			dfs(i + 1, res);
			vis[j] = 0; res.pop_back();
		}
	}
}

int solve(int i, int opt) {
	if (opt == m + 1) return i == 1;
	if (dp[i][opt] != -1) return dp[i][opt];
	int ans = 0;
	for (auto j : edges[i]) (ans += solve(j, opt + 1)) %= p;
	return dp[i][opt] = ans;
}

signed main() {
	freopen("drama.in", "r", stdin);
	freopen("drama.out", "w", stdout);
	cin >> n >> m;
	dfs(1, {});
	for (auto i : hashv) {
		vector<int> nx = i.first;
		edges[i.second].push_back(i.second);
		for (int pos = 1; pos < nx.size(); ++pos) {
			swap(nx[pos], nx[pos - 1]);
			edges[i.second].push_back(hashv[nx]);
		}
	}
	memset(dp, 255, sizeof(dp));
	cout << solve(1, 1) << "\n";
	return 0;
}
/*
 2 3 1 4 5 6
 */
